home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / SoundComponents.a < prev    next >
Encoding:
Text File  |  1996-05-29  |  19.3 KB  |  690 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        SoundComponents.a
  3. ;
  4. ;    Contains:    Sound Components Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2.1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__SOUNDCOMPONENTS__') = 'UNDEFINED' THEN
  21. __SOUNDCOMPONENTS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  30.     include 'Components.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33.  
  34.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  35.     include 'Sound.a'
  36.     ENDIF
  37. ;
  38. ;                        * * *  N O T E  * * *
  39. ;
  40. ;    This file has been updated to include Sound Manager 3.2 interfaces.
  41. ;
  42. ;    Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  43. ;    that originally shipped with the PowerMacs. These missing functions and the
  44. ;    new 3.2 interfaces have been released in the SoundLib library for PowerPC
  45. ;    developers to link with. The runtime library for these functions are
  46. ;    installed by Sound Manager 3.2. The following functions are found in SoundLib.
  47. ;
  48. ;        AudioGetBass, AudioGetInfo, AudioGetMute, AudioGetOutputDevice,
  49. ;        AudioGetTreble, AudioGetVolume, AudioMuteOnEvent, AudioSetBass,
  50. ;        AudioSetMute, AudioSetToDefaults, AudioSetTreble, AudioSetVolume,
  51. ;        OpenMixerSoundComponent, CloseMixerSoundComponent, SoundComponentAddSource,
  52. ;        SoundComponentGetInfo, SoundComponentGetSource, SoundComponentGetSourceData,
  53. ;        SoundComponentInitOutputDevice, SoundComponentPauseSource,
  54. ;        SoundComponentPlaySourceBuffer, SoundComponentRemoveSource,
  55. ;        SoundComponentSetInfo, SoundComponentSetOutput, SoundComponentSetSource,
  56. ;        SoundComponentStartSource, SoundComponentStopSource
  57. ;
  58. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. ; constants
  60. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  61.  
  62. kNoSoundComponentType            EQU        '****'
  63. kSoundComponentType                EQU        'sift'                ;component type
  64. kSoundComponentPPCType            EQU        'nift'                ;component type for PowerPC code
  65. kRate8SubType                    EQU        'ratb'                ;8-bit rate converter
  66. kRate16SubType                    EQU        'ratw'                ;16-bit rate converter
  67. kConverterSubType                EQU        'conv'                ;sample format converter
  68. kSndSourceSubType                EQU        'sour'                ;generic source component
  69. kMixerType                        EQU        'mixr'
  70. kMixer8SubType                    EQU        'mixb'                ;8-bit mixer
  71. kMixer16SubType                    EQU        'mixw'                ;16-bit mixer
  72. kSoundOutputDeviceType            EQU        'sdev'                ;sound output component
  73. kClassicSubType                    EQU        'clas'                ;classic hardware, i.e. Mac Plus
  74. kASCSubType                        EQU        'asc '                ;Apple Sound Chip device
  75. kDSPSubType                        EQU        'dsp '                ;DSP device
  76. kAwacsSubType                    EQU        'awac'                ;Another of Will's Audio Chips device
  77. kGCAwacsSubType                    EQU        'awgc'                ;Awacs audio with Grand Central DMA
  78. kSingerSubType                    EQU        'sing'                ;Singer (via Whitney) based sound
  79. kSinger2SubType                    EQU        'sng2'                ;Singer 2 (via Whitney) for Acme
  80. kWhitSubType                    EQU        'whit'                ;Whit sound component for PrimeTime 3
  81. kSoundBlasterSubType            EQU        'sbls'                ;Sound Blaster for CHRP
  82. kSoundCompressor                EQU        'scom'
  83. kSoundDecompressor                EQU        'sdec'
  84. kMace3SubType                    EQU        'MAC3'                ;MACE 3:1
  85. kMace6SubType                    EQU        'MAC6'                ;MACE 6:1
  86. kCDXA4SubType                    EQU        'cdx4'                ;CD/XA 4:1
  87. kCDXA2SubType                    EQU        'cdx2'                ;CD/XA 2:1
  88. kIMA4SubType                    EQU        'ima4'                ;IMA 4:1
  89. kULawSubType                    EQU        'ulaw'                ;µLaw 2:1
  90. kLittleEndianSubType            EQU        'sowt'                ;Little-endian
  91. kAudioComponentType                EQU        'adio'                ;Audio components and sub-types
  92. kAwacsPhoneSubType                EQU        'hphn'
  93. kAudioVisionSpeakerSubType        EQU        'telc'
  94. kAudioVisionHeadphoneSubType    EQU        'telh'
  95. kPhilipsFaderSubType            EQU        'tvav'
  96.  
  97. ;sound component set/get info selectors
  98. siVolume                        EQU        'volu'
  99. siHardwareVolume                EQU        'hvol'
  100. siSpeakerVolume                    EQU        'svol'
  101. siHeadphoneVolume                EQU        'pvol'
  102. siHardwareVolumeSteps            EQU        'hstp'
  103. siHeadphoneVolumeSteps            EQU        'hdst'
  104. siHardwareMute                    EQU        'hmut'
  105. siSpeakerMute                    EQU        'smut'
  106. siHeadphoneMute                    EQU        'pmut'
  107. siRateMultiplier                EQU        'rmul'
  108. siQuality                        EQU        'qual'
  109. siWideStereo                    EQU        'wide'
  110. siHardwareFormat                EQU        'hwfm'
  111. siPreMixerSoundComponent        EQU        'prmx'
  112. siPostMixerSoundComponent        EQU        'psmx'
  113. kOffsetBinary                    EQU        'raw '                ;format types
  114. kTwosComplement                    EQU        'twos'
  115. kMACE3Compression                EQU        'MAC3'
  116. kMACE6Compression                EQU        'MAC6'
  117.  
  118. ;quality flags
  119. ;use interpolation in rate conversion
  120. kBestQuality                    EQU        (1 << 0)
  121.  
  122. ;useful bit masks
  123. kInputMask                        EQU        $000000FF            ;masks off input bits
  124. kOutputMask                        EQU        $0000FF00            ;masks off output bits
  125. kOutputShift                    EQU        8                    ;amount output bits are shifted
  126. kActionMask                        EQU        $00FF0000            ;masks off action bits
  127. kSoundComponentBits                EQU        $00FFFFFF
  128.  
  129. ;SoundComponentPlaySourceBuffer action flags
  130. kSourcePaused                    EQU        (1 << 0)
  131. kPassThrough                    EQU        (1 << 16)
  132. kNoSoundComponentChain            EQU        (1 << 17)
  133. ;flags for OpenMixerSoundComponent
  134. kNoMixing                        EQU        (1 << 0)            ;don't mix source
  135. kNoSampleRateConversion            EQU        (1 << 1)            ;don't convert sample rate (i.e. 11 kHz -> 22 kHz)
  136. kNoSampleSizeConversion            EQU        (1 << 2)            ;don't convert sample size (i.e. 16 -> 8)
  137. kNoSampleFormatConversion        EQU        (1 << 3)            ;don't convert sample format (i.e. 'twos' -> 'raw ')
  138. kNoChannelConversion            EQU        (1 << 4)            ;don't convert stereo/mono
  139. kNoDecompression                EQU        (1 << 5)            ;don't decompress (i.e. 'MAC3' -> 'raw ')
  140. kNoVolumeConversion                EQU        (1 << 6)            ;don't apply volume
  141. kNoRealtimeProcessing            EQU        (1 << 7)            ;won't run at interrupt time
  142.  
  143. ;Audio Component constants
  144. ;Values for whichChannel parameter
  145. audioAllChannels                EQU        0                    ;All channels (usually interpreted as both left and right)
  146. audioLeftChannel                EQU        1                    ;Left channel
  147. audioRightChannel                EQU        2                    ;Right channel
  148. ;Values for mute parameter
  149. audioUnmuted                    EQU        0                    ;Device is unmuted
  150. audioMuted                        EQU        1                    ;Device is muted
  151. ;Capabilities flags definitions
  152. audioDoesMono                    EQU        (1 << 0)            ;Device supports mono output
  153. audioDoesStereo                    EQU        (1 << 1)            ;Device supports stereo output
  154. audioDoesIndependentChannels    EQU        (1 << 2)            ;Device supports independent software control of each channel
  155.  
  156. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  157. ; typedefs
  158. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  159. ;ShortFixed consists of an 8 bit, 2's complement integer part in the high byte,
  160. ;with an 8 bit fractional part in the low byte; its range is -128 to 127.99609375
  161. ; typedef short             ShortFixed
  162.  
  163.  
  164. ; typedef struct SoundParamBlock  SoundParamBlock
  165. ; typedef SoundParamBlock     *SoundParamBlockPtr
  166. SoundParamBlock         RECORD    0
  167. recordSize                 ds.l   1        ; offset: $0 (0)        ;size of this record in bytes
  168. desc                     ds     SoundComponentData ; offset: $4 (4) ;description of sound buffer
  169. rateMultiplier             ds.l   1        ; offset: $20 (32)        ;rate multiplier to apply to sound
  170. leftVolume                 ds.w   1        ; offset: $24 (36)        ;volumes to apply to sound
  171. rightVolume                 ds.w   1        ; offset: $26 (38)
  172. quality                     ds.l   1        ; offset: $28 (40)        ;quality to apply to sound
  173. filter                     ds.l   1        ; offset: $2C (44)        ;filter to apply to sound
  174. moreRtn                     ds.l   1        ; offset: $30 (48)        ;routine to call to get more data
  175. completionRtn             ds.l   1        ; offset: $34 (52)        ;routine to call when buffer is complete
  176. refCon                     ds.l   1        ; offset: $38 (56)        ;user refcon
  177. result                     ds.w   1        ; offset: $3C (60)        ;result
  178. sizeof                     EQU *            ; size:   $3E (62)
  179.                         ENDR
  180.  
  181. ; typedef void                 *SoundSource
  182.  
  183. SoundComponentLink        RECORD 0
  184. description                 ds        ComponentDescription ; offset: $0 (0)    ; Describes the sound component
  185. mixerID                     ds.l    1                ; offset: $14 (20)        ; Reserved by Apple
  186. linkID                     ds.l    1                ; offset: $18 (24)        ; Reserved by Apple
  187. sizeof                     EQU *                    ; size:   $1C (28)
  188.                         ENDR
  189. ; typedef struct SoundComponentLink *    SoundComponentLinkPtr
  190.  
  191. AudioInfo                 RECORD    0
  192. capabilitiesFlags         ds.l   1        ; offset: $0 (0)        ;Describes device capabilities
  193. reserved                 ds.l   1        ; offset: $4 (4)        ;Reserved by Apple
  194. numVolumeSteps             ds.w   1        ; offset: $8 (8)        ;Number of significant increments between min and max volume
  195. sizeof                     EQU *            ; size:   $A (10)
  196.                         ENDR
  197.  
  198. ; typedef struct AudioInfo     AudioInfo
  199. ; typedef AudioInfo         *AudioInfoPtr
  200. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  201. ; functions for sound components
  202. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  203. ;Sound Component dispatch selectors
  204.  
  205. ;these calls cannot be delegated
  206. kSoundComponentInitOutputDeviceSelect EQU        1
  207. kSoundComponentSetSourceSelect    EQU        2
  208. kSoundComponentGetSourceSelect    EQU        3
  209. kSoundComponentGetSourceDataSelect EQU        4
  210. kSoundComponentSetOutputSelect    EQU        5
  211. kDelegatedSoundComponentSelectors EQU        $0100                ;first selector that can be delegated up the chain
  212. ;these calls can be delegated and have own range
  213. kSoundComponentAddSourceSelect    EQU        kDelegatedSoundComponentSelectors + 1
  214. kSoundComponentRemoveSourceSelect EQU        kDelegatedSoundComponentSelectors + 2
  215. kSoundComponentGetInfoSelect    EQU        kDelegatedSoundComponentSelectors + 3
  216. kSoundComponentSetInfoSelect    EQU        kDelegatedSoundComponentSelectors + 4
  217. kSoundComponentStartSourceSelect EQU        kDelegatedSoundComponentSelectors + 5
  218. kSoundComponentStopSourceSelect    EQU        kDelegatedSoundComponentSelectors + 6
  219. kSoundComponentPauseSourceSelect EQU        kDelegatedSoundComponentSelectors + 7
  220. kSoundComponentPlaySourceBufferSelect EQU        kDelegatedSoundComponentSelectors + 8
  221.  
  222. ;Audio Component selectors
  223. kAudioGetVolumeSelect            EQU        0
  224. kAudioSetVolumeSelect            EQU        1
  225. kAudioGetMuteSelect                EQU        2
  226. kAudioSetMuteSelect                EQU        3
  227. kAudioSetToDefaultsSelect        EQU        4
  228. kAudioGetInfoSelect                EQU        5
  229. kAudioGetBassSelect                EQU        6
  230. kAudioSetBassSelect                EQU        7
  231. kAudioGetTrebleSelect            EQU        8
  232. kAudioSetTrebleSelect            EQU        9
  233. kAudioGetOutputDeviceSelect        EQU        10
  234. kAudioMuteOnEventSelect            EQU        129
  235.  
  236. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  237. ; Sound Manager 3.0 utilities
  238. ;
  239. ; pascal OSErr OpenMixerSoundComponent(SoundComponentDataPtr outputDescription, long outputFlags, ComponentInstance *mixerComponent)
  240. ;
  241.     IF ¬ GENERATINGCFM THEN
  242.         Macro
  243.         _OpenMixerSoundComponent
  244.             dc.w     $203C
  245.             dc.w     $0614
  246.             dc.w     $0018
  247.             dc.w     $A800
  248.         EndM
  249.     ELSE
  250.         IMPORT_CFM_FUNCTION    OpenMixerSoundComponent
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal OSErr CloseMixerSoundComponent(ComponentInstance ci)
  255. ;
  256.     IF ¬ GENERATINGCFM THEN
  257.         Macro
  258.         _CloseMixerSoundComponent
  259.             dc.w     $203C
  260.             dc.w     $0218
  261.             dc.w     $0018
  262.             dc.w     $A800
  263.         EndM
  264.     ELSE
  265.         IMPORT_CFM_FUNCTION    CloseMixerSoundComponent
  266.     ENDIF
  267.  
  268. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  269. ; basic sound component functions
  270. ;
  271. ; pascal ComponentResult SoundComponentInitOutputDevice(ComponentInstance ti, long actions)
  272. ;
  273.     IF ¬ GENERATINGCFM THEN
  274.         Macro
  275.         _SoundComponentInitOutputDevice
  276.             dc.w     $2F3C
  277.             dc.w     $0004
  278.             dc.w     $0001
  279.             moveq    #0,d0
  280.             dc.w     $A82A
  281.         EndM
  282.     ELSE
  283.         IMPORT_CFM_FUNCTION    SoundComponentInitOutputDevice
  284.     ENDIF
  285.  
  286. ;
  287. ; pascal ComponentResult SoundComponentSetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance source)
  288. ;
  289.     IF ¬ GENERATINGCFM THEN
  290.         Macro
  291.         _SoundComponentSetSource
  292.             dc.w     $2F3C
  293.             dc.w     $0008
  294.             dc.w     $0002
  295.             moveq    #0,d0
  296.             dc.w     $A82A
  297.         EndM
  298.     ELSE
  299.         IMPORT_CFM_FUNCTION    SoundComponentSetSource
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal ComponentResult SoundComponentGetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance *source)
  304. ;
  305.     IF ¬ GENERATINGCFM THEN
  306.         Macro
  307.         _SoundComponentGetSource
  308.             dc.w     $2F3C
  309.             dc.w     $0008
  310.             dc.w     $0003
  311.             moveq    #0,d0
  312.             dc.w     $A82A
  313.         EndM
  314.     ELSE
  315.         IMPORT_CFM_FUNCTION    SoundComponentGetSource
  316.     ENDIF
  317.  
  318. ;
  319. ; pascal ComponentResult SoundComponentGetSourceData(ComponentInstance ti, SoundComponentDataPtr *sourceData)
  320. ;
  321.     IF ¬ GENERATINGCFM THEN
  322.         Macro
  323.         _SoundComponentGetSourceData
  324.             dc.w     $2F3C
  325.             dc.w     $0004
  326.             dc.w     $0004
  327.             moveq    #0,d0
  328.             dc.w     $A82A
  329.         EndM
  330.     ELSE
  331.         IMPORT_CFM_FUNCTION    SoundComponentGetSourceData
  332.     ENDIF
  333.  
  334. ;
  335. ; pascal ComponentResult SoundComponentSetOutput(ComponentInstance ti, SoundComponentDataPtr requested, SoundComponentDataPtr *actual)
  336. ;
  337.     IF ¬ GENERATINGCFM THEN
  338.         Macro
  339.         _SoundComponentSetOutput
  340.             dc.w     $2F3C
  341.             dc.w     $0008
  342.             dc.w     $0005
  343.             moveq    #0,d0
  344.             dc.w     $A82A
  345.         EndM
  346.     ELSE
  347.         IMPORT_CFM_FUNCTION    SoundComponentSetOutput
  348.     ENDIF
  349.  
  350. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  351. ; junction methods for the mixer, must be called at non-interrupt level
  352. ;
  353. ; pascal ComponentResult SoundComponentAddSource(ComponentInstance ti, SoundSource *sourceID)
  354. ;
  355.     IF ¬ GENERATINGCFM THEN
  356.         Macro
  357.         _SoundComponentAddSource
  358.             dc.w     $2F3C
  359.             dc.w     $0004
  360.             dc.w     $0101
  361.             moveq    #0,d0
  362.             dc.w     $A82A
  363.         EndM
  364.     ELSE
  365.         IMPORT_CFM_FUNCTION    SoundComponentAddSource
  366.     ENDIF
  367.  
  368. ;
  369. ; pascal ComponentResult SoundComponentRemoveSource(ComponentInstance ti, SoundSource sourceID)
  370. ;
  371.     IF ¬ GENERATINGCFM THEN
  372.         Macro
  373.         _SoundComponentRemoveSource
  374.             dc.w     $2F3C
  375.             dc.w     $0004
  376.             dc.w     $0102
  377.             moveq    #0,d0
  378.             dc.w     $A82A
  379.         EndM
  380.     ELSE
  381.         IMPORT_CFM_FUNCTION    SoundComponentRemoveSource
  382.     ENDIF
  383.  
  384. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  385. ; info methods
  386. ;
  387. ; pascal ComponentResult SoundComponentGetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  388. ;
  389.     IF ¬ GENERATINGCFM THEN
  390.         Macro
  391.         _SoundComponentGetInfo
  392.             dc.w     $2F3C
  393.             dc.w     $000C
  394.             dc.w     $0103
  395.             moveq    #0,d0
  396.             dc.w     $A82A
  397.         EndM
  398.     ELSE
  399.         IMPORT_CFM_FUNCTION    SoundComponentGetInfo
  400.     ENDIF
  401.  
  402. ;
  403. ; pascal ComponentResult SoundComponentSetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  404. ;
  405.     IF ¬ GENERATINGCFM THEN
  406.         Macro
  407.         _SoundComponentSetInfo
  408.             dc.w     $2F3C
  409.             dc.w     $000C
  410.             dc.w     $0104
  411.             moveq    #0,d0
  412.             dc.w     $A82A
  413.         EndM
  414.     ELSE
  415.         IMPORT_CFM_FUNCTION    SoundComponentSetInfo
  416.     ENDIF
  417.  
  418. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  419. ; control methods
  420. ;
  421. ; pascal ComponentResult SoundComponentStartSource(ComponentInstance ti, short count, SoundSource *sources)
  422. ;
  423.     IF ¬ GENERATINGCFM THEN
  424.         Macro
  425.         _SoundComponentStartSource
  426.             dc.w     $2F3C
  427.             dc.w     $0006
  428.             dc.w     $0105
  429.             moveq    #0,d0
  430.             dc.w     $A82A
  431.         EndM
  432.     ELSE
  433.         IMPORT_CFM_FUNCTION    SoundComponentStartSource
  434.     ENDIF
  435.  
  436. ;
  437. ; pascal ComponentResult SoundComponentStopSource(ComponentInstance ti, short count, SoundSource *sources)
  438. ;
  439.     IF ¬ GENERATINGCFM THEN
  440.         Macro
  441.         _SoundComponentStopSource
  442.             dc.w     $2F3C
  443.             dc.w     $0006
  444.             dc.w     $0106
  445.             moveq    #0,d0
  446.             dc.w     $A82A
  447.         EndM
  448.     ELSE
  449.         IMPORT_CFM_FUNCTION    SoundComponentStopSource
  450.     ENDIF
  451.  
  452. ;
  453. ; pascal ComponentResult SoundComponentPauseSource(ComponentInstance ti, short count, SoundSource *sources)
  454. ;
  455.     IF ¬ GENERATINGCFM THEN
  456.         Macro
  457.         _SoundComponentPauseSource
  458.             dc.w     $2F3C
  459.             dc.w     $0006
  460.             dc.w     $0107
  461.             moveq    #0,d0
  462.             dc.w     $A82A
  463.         EndM
  464.     ELSE
  465.         IMPORT_CFM_FUNCTION    SoundComponentPauseSource
  466.     ENDIF
  467.  
  468. ;
  469. ; pascal ComponentResult SoundComponentPlaySourceBuffer(ComponentInstance ti, SoundSource sourceID, SoundParamBlockPtr pb, long actions)
  470. ;
  471.     IF ¬ GENERATINGCFM THEN
  472.         Macro
  473.         _SoundComponentPlaySourceBuffer
  474.             dc.w     $2F3C
  475.             dc.w     $000C
  476.             dc.w     $0108
  477.             moveq    #0,d0
  478.             dc.w     $A82A
  479.         EndM
  480.     ELSE
  481.         IMPORT_CFM_FUNCTION    SoundComponentPlaySourceBuffer
  482.     ENDIF
  483.  
  484. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  485. ; interface for Audio Components
  486. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  487. ;Volume is described as a value between 0 and 1, with 0 indicating minimum
  488. ;  volume and 1 indicating maximum volume; if the device doesn't support
  489. ;  software control of volume, then a value of unimpErr is returned, indicating
  490. ;  that these functions are not supported by the device
  491. ;
  492. ; pascal ComponentResult AudioGetVolume(ComponentInstance ac, short whichChannel, ShortFixed *volume)
  493. ;
  494.     IF ¬ GENERATINGCFM THEN
  495.         Macro
  496.         _AudioGetVolume
  497.             dc.w     $2F3C
  498.             dc.w     $0006
  499.             dc.w     $0000
  500.             moveq    #0,d0
  501.             dc.w     $A82A
  502.         EndM
  503.     ELSE
  504.         IMPORT_CFM_FUNCTION    AudioGetVolume
  505.     ENDIF
  506.  
  507. ;
  508. ; pascal ComponentResult AudioSetVolume(ComponentInstance ac, short whichChannel, ShortFixed volume)
  509. ;
  510.     IF ¬ GENERATINGCFM THEN
  511.         Macro
  512.         _AudioSetVolume
  513.             dc.w     $2F3C
  514.             dc.w     $0004
  515.             dc.w     $0001
  516.             moveq    #0,d0
  517.             dc.w     $A82A
  518.         EndM
  519.     ELSE
  520.         IMPORT_CFM_FUNCTION    AudioSetVolume
  521.     ENDIF
  522.  
  523. ;If the device doesn't support software control of mute, then a value of unimpErr is
  524. ;returned, indicating that these functions are not supported by the device
  525. ;
  526. ; pascal ComponentResult AudioGetMute(ComponentInstance ac, short whichChannel, short *mute)
  527. ;
  528.     IF ¬ GENERATINGCFM THEN
  529.         Macro
  530.         _AudioGetMute
  531.             dc.w     $2F3C
  532.             dc.w     $0006
  533.             dc.w     $0002
  534.             moveq    #0,d0
  535.             dc.w     $A82A
  536.         EndM
  537.     ELSE
  538.         IMPORT_CFM_FUNCTION    AudioGetMute
  539.     ENDIF
  540.  
  541. ;
  542. ; pascal ComponentResult AudioSetMute(ComponentInstance ac, short whichChannel, short mute)
  543. ;
  544.     IF ¬ GENERATINGCFM THEN
  545.         Macro
  546.         _AudioSetMute
  547.             dc.w     $2F3C
  548.             dc.w     $0004
  549.             dc.w     $0003
  550.             moveq    #0,d0
  551.             dc.w     $A82A
  552.         EndM
  553.     ELSE
  554.         IMPORT_CFM_FUNCTION    AudioSetMute
  555.     ENDIF
  556.  
  557. ;AudioSetToDefaults causes the associated device to reset its volume and mute values
  558. ;(and perhaps other characteristics, e.g. attenuation) to "factory default" settings
  559. ;
  560. ; pascal ComponentResult AudioSetToDefaults(ComponentInstance ac)
  561. ;
  562.     IF ¬ GENERATINGCFM THEN
  563.         Macro
  564.         _AudioSetToDefaults
  565.             dc.w     $2F3C
  566.             dc.w     $0000
  567.             dc.w     $0004
  568.             moveq    #0,d0
  569.             dc.w     $A82A
  570.         EndM
  571.     ELSE
  572.         IMPORT_CFM_FUNCTION    AudioSetToDefaults
  573.     ENDIF
  574.  
  575. ;This routine is required; it must be implemented by all audio components
  576. ;
  577. ; pascal ComponentResult AudioGetInfo(ComponentInstance ac, AudioInfoPtr info)
  578. ;
  579.     IF ¬ GENERATINGCFM THEN
  580.         Macro
  581.         _AudioGetInfo
  582.             dc.w     $2F3C
  583.             dc.w     $0004
  584.             dc.w     $0005
  585.             moveq    #0,d0
  586.             dc.w     $A82A
  587.         EndM
  588.     ELSE
  589.         IMPORT_CFM_FUNCTION    AudioGetInfo
  590.     ENDIF
  591.  
  592. ;
  593. ; pascal ComponentResult AudioGetBass(ComponentInstance ac, short whichChannel, short *bass)
  594. ;
  595.     IF ¬ GENERATINGCFM THEN
  596.         Macro
  597.         _AudioGetBass
  598.             dc.w     $2F3C
  599.             dc.w     $0006
  600.             dc.w     $0006
  601.             moveq    #0,d0
  602.             dc.w     $A82A
  603.         EndM
  604.     ELSE
  605.         IMPORT_CFM_FUNCTION    AudioGetBass
  606.     ENDIF
  607.  
  608. ;
  609. ; pascal ComponentResult AudioSetBass(ComponentInstance ac, short whichChannel, short bass)
  610. ;
  611.     IF ¬ GENERATINGCFM THEN
  612.         Macro
  613.         _AudioSetBass
  614.             dc.w     $2F3C
  615.             dc.w     $0004
  616.             dc.w     $0007
  617.             moveq    #0,d0
  618.             dc.w     $A82A
  619.         EndM
  620.     ELSE
  621.         IMPORT_CFM_FUNCTION    AudioSetBass
  622.     ENDIF
  623.  
  624. ;
  625. ; pascal ComponentResult AudioGetTreble(ComponentInstance ac, short whichChannel, short *Treble)
  626. ;
  627.     IF ¬ GENERATINGCFM THEN
  628.         Macro
  629.         _AudioGetTreble
  630.             dc.w     $2F3C
  631.             dc.w     $0006
  632.             dc.w     $0008
  633.             moveq    #0,d0
  634.             dc.w     $A82A
  635.         EndM
  636.     ELSE
  637.         IMPORT_CFM_FUNCTION    AudioGetTreble
  638.     ENDIF
  639.  
  640. ;
  641. ; pascal ComponentResult AudioSetTreble(ComponentInstance ac, short whichChannel, short Treble)
  642. ;
  643.     IF ¬ GENERATINGCFM THEN
  644.         Macro
  645.         _AudioSetTreble
  646.             dc.w     $2F3C
  647.             dc.w     $0004
  648.             dc.w     $0009
  649.             moveq    #0,d0
  650.             dc.w     $A82A
  651.         EndM
  652.     ELSE
  653.         IMPORT_CFM_FUNCTION    AudioSetTreble
  654.     ENDIF
  655.  
  656. ;
  657. ; pascal ComponentResult AudioGetOutputDevice(ComponentInstance ac, Component *outputDevice)
  658. ;
  659.     IF ¬ GENERATINGCFM THEN
  660.         Macro
  661.         _AudioGetOutputDevice
  662.             dc.w     $2F3C
  663.             dc.w     $0004
  664.             dc.w     $000A
  665.             moveq    #0,d0
  666.             dc.w     $A82A
  667.         EndM
  668.     ELSE
  669.         IMPORT_CFM_FUNCTION    AudioGetOutputDevice
  670.     ENDIF
  671.  
  672. ;This is routine is private to the AudioVision component.  It enables the watching of the mute key.
  673. ;
  674. ; pascal ComponentResult AudioMuteOnEvent(ComponentInstance ac, short muteOnEvent)
  675. ;
  676.     IF ¬ GENERATINGCFM THEN
  677.         Macro
  678.         _AudioMuteOnEvent
  679.             dc.w     $2F3C
  680.             dc.w     $0002
  681.             dc.w     $0081
  682.             moveq    #0,d0
  683.             dc.w     $A82A
  684.         EndM
  685.     ELSE
  686.         IMPORT_CFM_FUNCTION    AudioMuteOnEvent
  687.     ENDIF
  688.  
  689.     ENDIF ; __SOUNDCOMPONENTS__
  690.